﻿using System.Linq;
using Tools.Domain.Common.Repositories.Contracts;
using Tools.Domain.Specifications;
using Webshop20.Domain.Customers.Core;
using Webshop20.Domain.Orders.Core;
using Webshop20.Domain.Orders.Enumerations;

namespace Webshop20.Model.Orders.Specifications
{
    public class OpenInvoiceSpecification : Specification<Order>
    {
        //public OpenInvoiceSpecification(IRepository<Customer> customerRepository)
        //    : base(x => customerRepository.Find(c => c.Bill.Status == BillStatus.open || order.Bill.Status == BillStatus.delayed).Sum(order => order.Bill.CalculateTotal()) > VALUES.OPEN_INVOICE_LIMIT, "OPEN_INVOICE_LIMIT_EXEEDED")
        //{

        //}
    }
}
